#include <iostream>
#include<vector>
#include <sstream>
#include <string>
#include <algorithm>
using namespace std;

string re(string str) {
    reverse(str.begin(), str.end());
    return str;
}

int main() {
    string line;
    while (getline(cin, line)) {
    	vector<string>results;
        istringstream ss(line);
        string str;
        while (ss >> str) {
            results.push_back(str); // 反转单词并添加到结果中
        }
        reverse(results.begin(),results.end());
        for(string ch:results){
        cout << ch <<" "; 	}// 输出结果
        cout<<endl;
}
    return 0;
}